package dfbz.线程锁3;
/*
 * lock  需要手动获取和释放锁 手动释放锁建议放在finally中  让释放锁的操作一定会执行
 * synchronized  获取锁，程序执行完毕后释放锁
 * */
public class Test {
    public static void main(String[] args) {

        RunnableImpl rb=new RunnableImpl();
        Thread t1 = new Thread(rb, "窗口1");
        Thread t2 = new Thread(rb, "窗口2");
        Thread t3 = new Thread(rb, "窗口3");

        t1.start();
        t2.start();
        t3.start();
    }
}
